package edu.zut.service.impl;

import edu.zut.mapper.UserMapper;
import edu.zut.pojo.UserInfo;
import edu.zut.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public boolean getInfoByEmail(String email) {
        UserInfo info = userMapper.findEmail(email);
        if (null == info){
            return false;
        }
        return true;
    }

    @Override
    public List<UserInfo> queryList() {
        return userMapper.findAll();
    }

    @Override
    public boolean updateYZM(String email, String zym) {
        int i = userMapper.saveZym(email,zym);
        if (i == 1){
            return true;
        }
        return false;
    }
}
